fix: added a len check before draining#3630
Open
mohan-bee wants to merge 2 commits intoGraphiteEditor:masterfrom
Open
fix: added a len check before draining#3630mohan-bee wants to merge 2 commits intoGraphiteEditor:masterfrom
mohan-bee wants to merge 2 commits intoGraphiteEditor:masterfrom
Conversation
Author
|
@adamgerhant review pls ! |
Member
Author
|
@Keavon i have added default unit value input so that the identity node can function properly. |
adamgerhant
requested changes
Jan 15, 2026
| if node.inputs.len() > 1 { | ||
| node.inputs.drain(1..); | ||
| } else if node.inputs.is_empty() { | ||
| node.inputs.push(NodeInput::value(TaggedValue::None, false)); |
Collaborator
There was a problem hiding this comment.
If a node with no inputs is hidden, the identity node value should be based on the output type. This can be represented by changing the visible field on DocumentNode to store an enum like
pub enum Visible {
Passthrough,
Value(Type),
}
Then in the editor, when hiding the node, if the node has no inputs it gets set the the Value variant with the Type based on the output type of that node. This Type is then used to construct the tagged value, instead of using TaggedValue::None.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



fixes #3629
issue: node.inputs tries to drain from the index 1 which causes the crash
fix: added a len check before draining
before:
Screen.Recording.2026-01-13.at.11.02.05.AM.mov
after:
Screen.Recording.2026-01-13.at.11.00.56.AM.mov